<?php
/*
<Model Information> 
Author: Naseer Ahmad
Date: 14-07-2011
Last Updated on:
Last Updated by:
*/


class addInventoryModel extends appModel
{
	var $name = 'addInventoryModel';
	
				function add($productname, 
								$openingbalance, 
								$productcategory, 
								$productdeail,
								$productquantity,
								$productcostperunit, 
								$productpriceperunit, 
								$productpicture,
								$productunit,
								$productexpirydate)
		{
			$fv = array('productName'			=>	$productname,
						'openingBalance'		=>	$openingbalance,
						'productCategory'		=>	$productcategory,
						'productDetail'			=>	$productdeail,
						'productQuantity'		=>	$productquantity,
						'productCostPerUnit'	=>	$productcostperunit,
						'productPricePerUnit'	=>	$productpriceperunit,
						'productPicture'		=>	$productpicture,
						'productUnit'			=>	$productunit,
						'productExpiryDate'		=>	$productexpirydate);
						
			if($this -> _insertTable('stockInfo', $fv))
				return true;
			else
				return false;
		}

		function updateAccountHeads($id,
								$accountName, 
								$accountType, 
								$firstName, 
								$lastName,
								$fullAddress,
								$city, 
								$phoneNumber, 
								$email)
		{
			$fv = array('accountName'	=>	$accountName,
						'accountType'	=>	$accountType,
						'firstName'		=>	$firstName,
						'lastName'		=>	$lastName,
						'fullAddress'	=>	$fullAddress,
						'city'			=>	$city,
						'phoneNumber'	=>	$phoneNumber,
						'email'			=>	$email,
						'userName'		=>	$_COOKIE['userNickName_finsol']);
						
			$where=array("accountID"	=> $id);
			if($this -> _updateTable('acountHeads', $fv, $where))
				return true;
			else
				return false;
		}
						
	
}

?>